#include <iostream>
#include <cstring>
using namespace std;
int a[100000];
int main()
{
	int n;
	int k;
	cin>>n>>k;
	memset(a,0,sizeof(a));
	a[0]=1;
	
	for(int i=2;i<=k;i++){
		for(int j=1;j<=n&&i*j<=n;j++){
			if(a[i*j]==0) a[i*j]=1;
			else a[i*j]=0;
		}
	}
	int b[1001];
	int jishu=0;
	for(int kk=1;kk<=n;kk++){
		if(a[kk]==0) {
			b[jishu]=kk;
			jishu++;
		}
	}
	
	for(int d=0;d<jishu;d++){
		if(d==jishu-1) cout<<b[d]<<endl;
		else cout<<b[d]<<" ";
	}
	return 0;
}
